3 It is now possible to measure temperatures with the help of the I²C LM75 and 1-Wire DS18B20 chips. The temperature values can be displayed on the OSD and they are also logged. A total maximum of 8 temperature sensors can be connected. The support is enabled by default on F4 and F7 FCs. To use with F3 FCs you need to build a custom firmware.
7 Up to 8 can be connected to the flight controller.
9 * Package: SOP-8, breakout boards can be found easily
10 * Interface: I²C (**max 400kHz**)
12 * Temperature range: -55 to +125°C
16 * Package: TO-92, SO-8, µSOP-8
18 * Supply: 3.0 to 5.5V (parasitic power not supported)
19 * Temperature range: -55 to +125°C
21 None of the flight controllers on the market at the time this documentation is written supports 1-Wire directly. To use these sensors a I²C to 1-Wire interface chip needs to be used, the DS2482. Connect the DS2482 SCL and SDA lines to your FC, add a 4.7kohm pull-up resistor between VCC and the DQ pin then connect all the sensors DQ pin to the DS2482 DQ pin.
23 ## Configuring temperature sensors
25 The `temp_sensor` CLI command can be used to display and change the temperature sensors configuration. When a new temperature sensor is connected it is automatically detected and will appear in the output of the `temp_sensor` command.
27 * `temp_sensor` without any argument displays all the sensors configuration
28 * `temp_sensor reset` deletes all the sensors
29 * `temp_sensor index type address alarm_min alarm_max osd_symbol label` to configure a new sensor or modify the configuration of an existing one.
31 ### Parameters description
33 * `index` is the index of the configuration slot you want to change
34 * `type` can be `1` for LM75 or `2` for DS18B20
35 * `address` is the address of the device on the bus. 0 to 7 for a LM75 or the full 64bit ROM in hex format for a 18B20
36 * `alarm_min` is the temperature under which the corresponding OSD element will start blinking (decidegrees centigrade)
37 * `alarm_max` is the temperature above which the corresponding OSD element will start blinking (decidegrees centigrade)
38 * `osd_symbol` is the ID of a symbol to display on the OSD to the left of the temperature value. Use 0 to display a label instead (see next parameter). See the table bellow for the available IDs
39 * `label` is a 4 characters maximum label that is displayed on the OSD next to the temperature value
41 | Symbol ID | Description |
42 |-----------|-----------------------------|
43 | 1 | Generic temperature symbol |
44 | 2 | ESC temperature symbol |
45 | 3 | VTX temperature symbol |
46 | 4 | Motor temperature symbol |
47 | 5 | Battery temperature symbol |
48 | 6 | Exterior temperature symbol |
52 Example output of the `temp_sensor` command on a system with two LM75 and four DS18B20 sensors connected
55 temp_sensor 0 1 0 -200 600 0
56 temp_sensor 1 1 1 -200 600 0
57 temp_sensor 2 2 7c0118681e1cff28 -200 600 0
58 temp_sensor 3 2 7d01186838f2ff28 -200 600 0
59 temp_sensor 4 2 210118684001ff28 -200 600 0
60 temp_sensor 5 2 f801186750c7ff28 -200 600 0
65 To set for example the OSD symbol of the first temperature sensor to the ESC symbol:
67 `temp_sensor 0 1 0 -200 600 2`
69 To change for example the configuration of the fourth sensor to label `BATT`, minimum value alarm 0.5°C and maximum value alarm 45°C
71 `temp_sensor 3 2 7d01186838f2ff28 5 450 0 BATT`
73 ## Building a custom firmware with temperature sensor support (F3 only)
75 This needs to be added in the `target.h` file:
78 #define USE_TEMPERATURE_SENSOR
79 #define TEMPERATURE_I2C_BUS BUS_I2Cx // replace x with the index of the I²C bus the temperature sensors will be connected to
81 // for LM75 sensors support
82 #define USE_TEMPERATURE_LM75
84 // for DS18B20 sensors
86 #define USE_1WIRE_DS2482
87 #define USE_TEMPERATURE_DS18B20
90 ## Configuring the way OSD temperature labels are displayed
92 You can use the `osd_temp_label_align` setting to chose how the labels for the temperature sensor's values are displayed. Possible alignment values are `LEFT` and `RIGHT`.